package com.example.socialapp.domain.repository

import com.example.socialapp.domain.model.User
import kotlinx.coroutines.flow.Flow

/**
 * Repository interface for authentication operations
 */
interface AuthRepository {
    /**
     * Login with email and password
     *
     * @param email User email
     * @param password User password
     * @param rememberMe Whether to remember the user
     * @return Result containing User on success or Exception on failure
     */
    suspend fun login(email: String, password: String, rememberMe: Boolean): Result<User>
    
    /**
     * Register a new user
     *
     * @param email User email
     * @param password User password
     * @param displayName User display name
     * @return Result containing User on success or Exception on failure
     */
    suspend fun register(email: String, password: String, displayName: String): Result<User>
    
    /**
     * Login with Google
     *
     * @param idToken Google ID token
     * @return Result containing User on success or Exception on failure
     */
    suspend fun loginWithGoogle(idToken: String): Result<User>
    
    /**
     * Login with Facebook
     *
     * @param accessToken Facebook access token
     * @return Result containing User on success or Exception on failure
     */
    suspend fun loginWithFacebook(accessToken: String): Result<User>
    
    /**
     * Login with Apple
     *
     * @param identityToken Apple identity token
     * @return Result containing User on success or Exception on failure
     */
    suspend fun loginWithApple(identityToken: String): Result<User>
    
    /**
     * Send password reset email
     *
     * @param email User email
     * @return Result containing Unit on success or Exception on failure
     */
    suspend fun forgotPassword(email: String): Result<Unit>
    
    /**
     * Logout the current user
     *
     * @return Result containing Unit on success or Exception on failure
     */
    suspend fun logout(): Result<Unit>
    
    /**
     * Check if user is logged in
     *
     * @return Boolean indicating if user is logged in
     */
    fun isLoggedIn(): Boolean
    
    /**
     * Get the current logged in user
     *
     * @return Flow of User if logged in, or null if not logged in
     */
    fun getCurrentUser(): Flow<User?>
} 